package com.yuhanginfo.modules.web.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.yuhanginfo.modules.web.entity.WebHelp;
import com.yuhanginfo.modules.web.service.WebClassService;
import com.yuhanginfo.modules.web.service.WebHelpService;

/**
 * 帮助
 *
 */
@Controller
@RequestMapping(value = "${frontPath}/help")
public class HelpCenterController {
	@Autowired
	private WebHelpService helpService;
	@Autowired
	private WebClassService webClassService;
	@RequestMapping(value = "helpList")
	public String helpList(Integer classesType ,Model model){
		List<WebHelp> list=helpService.selectByType(classesType);
		List<WebHelp> list0=helpService.selectClassTypeList();
		model.addAttribute("list",list );
		model.addAttribute("list0",list0 );
		model.addAttribute("classesType", classesType);
		model.addAttribute("allClassesList",webClassService.getAllClasses());
		return "modules/web/help/helpCenter";
	}
	
	//详情
	@RequestMapping(value = "helpDetail")
	public String helpDetail(Integer classesType ,Model model,String id){
		List<WebHelp> list0=helpService.selectClassTypeList();
		WebHelp webHelp=helpService.selectById(id);
		model.addAttribute("list0",list0 );
		model.addAttribute("classesType", classesType);
		model.addAttribute("webHelp", webHelp);
		model.addAttribute("allClassesList",webClassService.getAllClasses());
		return "modules/web/help/helpDetail";
	}
	
	

}
